﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace ETL.Config
{
	public class ExcelFilesConfigSection : ConfigurationSection
	{
		[ConfigurationProperty("ExcelFiles")]
		public ExcelFilesCollection ExcelFiles
		{
			get { return ((ExcelFilesCollection)(base["ExcelFiles"])); }
		}
	}

	public class ExcelFilesConfigElement : ConfigurationElement
	{
		[ConfigurationProperty("name", DefaultValue = "", IsKey = true, IsRequired = true)]
		public string name { get { return ((string)(base["name"])); } set { base["name"] = value; } }

		[ConfigurationProperty("path", DefaultValue = "", IsKey = false, IsRequired = true)]
		public string path { get { return ((string)(base["path"])); } set { base["path"] = value; } }

		[ConfigurationProperty("sheetname", DefaultValue = "", IsKey = false, IsRequired = true)]
		public string sheetname { get { return ((string)(base["sheetname"])); } set { base["sheetname"] = value; } }

	}


	[ConfigurationCollection(typeof(ExcelFilesConfigElement))]
	public class ExcelFilesCollection : ConfigurationElementCollection
	{
		protected override ConfigurationElement CreateNewElement()
		{
			return new ExcelFilesConfigElement();
		}

		protected override object GetElementKey(ConfigurationElement element)
		{
			return ((ExcelFilesConfigElement)(element)).name;
		}

		public ExcelFilesConfigElement this[int idx]
		{
			get
			{
				return (ExcelFilesConfigElement)BaseGet(idx);
			}
		}

		protected override void BaseAdd(ConfigurationElement element)
		{
			base.BaseAdd(element);
		}

	}
}
